import { h, resolveComponent } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'

import DefaultLayout from '@/layouts/DefaultLayout'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: DefaultLayout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/homeIndex/index.vue'),
      },
      {
        path: '/Games',
        name: 'Games',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/Games/index.vue'),
      },
      {
        path: '/Community',
        name: 'Community',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/Community/index.vue'),
      },
      {
        path: '/icon',
        name: 'icon',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/icons/Brands.vue'),
      },
      {
        path: '/Farms',
        name: 'Farms',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/Farms/index.vue'),
      },
      {
        path: '/NFTMarket',
        name: 'NFTMarket',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/NFT/index.vue'),
      },
      {
        path: '/JgameNFTs',
        name: 'JgameNFTs',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/NFT/index.vue'),
      },
      {
        path: '/AboutJgame',
        name: 'AboutJgame',
        component: () =>
          import(/* webpackChunkName: "dashboard" */ '@/views/AboutJgame.vue'),
      },
    ]
  },
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes,
  scrollBehavior() {
    // always scroll to top
    return { top: 0 }
  },
})

export default router
